package models;

import java.util.*;

import javax.persistence.*;

import play.db.ebean.*;
import play.db.ebean.Model.Finder;
import play.data.format.*;
import play.data.validation.*;

import com.avaje.ebean.*;

@Entity
public class Matiere extends Model {

	@Id
	private Long idMatiere;

	@ManyToOne
	private Theme theme;

	@Constraints.Required
	private String libelleM;

	private List<Chapitre> sesChapitres;

	public static Finder<Long, Matiere> find = new Finder<Long, Matiere>(
			Long.class, Matiere.class);

	/*
	 * GETTER ET SETTER
	 */
	@OneToMany(mappedBy = "matiere")
	public List<Chapitre> getSesChapitres() {
		return sesChapitres;
	}

	public void setSesChapitres(List<Chapitre> t) {
		this.sesChapitres = t;
	}

	public Long getIdMatiere() {
		return idMatiere;
	}

	public void setIdMatiere(Long idMatiere) {
		this.idMatiere = idMatiere;
	}

	public Theme getTheme() {
		return theme;
	}

	public void setTheme(Theme theme) {
		this.theme = theme;
	}

	public String getLibelleM() {
		return libelleM;
	}

	public void setLibelleM(String libelleM) {
		this.libelleM = libelleM;
	}

}
